<!--{if $code == 'validate_remark'}-->
	
	<!--用户认证 专题简介-->
	<!--{if $remark_enable}-->
	<div class="side">
      <h3>媒体简介</h3>
      <ul class="sideul">
       <li>{$remark_content}</li>
      </ul>
    </div>
	<!--{/if}-->

	
<!--{elseif $code == 'validate_cement'}-->

	<!--用户认证 专题 公告-->
	<!--{if $cement_enable}-->
	<div class="side">
      <h3>公告</h3>
      <ul class="sideul">
       <li>{$cement_content}</li>
      </ul>
    </div>
	<!--{/if}-->


<!--{elseif $code == 'validate_link'}-->

	<!--用户认证 专题 友情链接-->
	<!--{if $link_enable}-->
	<div class="side">
      <h3>友情链接</h3>
      <ul class="sideul">
       <!--{if $link[title_1]}--><li><a href="{$link[url_1]}" target="_blank">{$link[title_1]}</a></li><br /><!--{/if}-->
	   <!--{if $link[title_2]}--><li><a href="{$link[url_2]}" target="_blank">{$link[title_2]}</a></li><br /><!--{/if}-->
	   <!--{if $link[title_3]}--><li><a href="{$link[url_3]}" target="_blank">{$link[title_3]}</a></li><br /><!--{/if}-->
	   <!--{if $link[title_4]}--><li><a href="{$link[url_4]}" target="_blank">{$link[title_4]}</a></li><br /><!--{/if}-->
	   <!--{if $link[title_5]}--><li><a href="{$link[url_5]}" target="_blank">{$link[title_5]}</a></li><!--{/if}-->
      </ul>
    </div>
	<!--{/if}-->
	
	
<!--{elseif $code == 'validate_video' && $video_enable}-->
	<!--{if $video_list}-->
	  <div class="side">
     
      <h3>视频</h3>
      <h3><!--{if $video_title}--><span title="{$_title}">{$video_title}</span><!--{/if}--></h3>
      <ul class="sideul">
        <!--{loop $video_list $val}-->
        <li>
          <div class="feedUservideo">
          <a id="a{$val[vid]}" onClick="javascript:showFlash('{$val[host]}', '{$val[id]}', this, '{$val[vid]}','{$val[url]}',1);" >
            <div id="play_{$val[vid]}" class="vP"></div>
            <!--{if $val[image_src]}-->
            <img src="{$val[image_src]}" style="border:none" />
            <!--{else}-->
            <img src="images/feedvideoplay.gif"  />
            <!--{/if}-->
            </a></div>
          <br />
        </li>
        <script type="text/javascript">
			$(document).ready(function(){
				$('#a{$val[vid]}').click();
			});				
		</script>
        <!--{/loop}-->
      </ul>
    </div>
	<!--{/if}-->
	
<!--{elseif $code == 'validate_vote' && $data = $extra['data']['validate_vote']['enable']}-->
<!--{IF $vote}-->
    <script type="text/javascript" src="js/vote.js"></script>
    <form id="vote_form" action="ajax.php?mod=vote&code=vote&vid=$vote[vid]&from=topic" method="post" name="vote_form">
	<div class="side">
      <h3>投票</h3>
 	  <ul class="sideul">
	 	<li><a href="index.php?mod=vote&code=view&vid={$vote[vid]}" target="_blank">{$vote[subject]}</a></li><br />
		<P><li>参与人数：{$vote[voter_num]}</li><P>
      </ul>
      
      <ul class="poll_item_list">
	 	<!--{eval $bcid = rand(0, 19);}-->
		<!--{loop $option $key $val}-->
		<li>
			<div>
				<label><input type="$vote[input_type]" name="option[]" value="$val[oid]" <!--{if $vote[multiple]}-->onclick="checkSelect(this.checked)"<!--{/if}-->>$val[option]</label>
				<!--{if $bcid>19}-->
				<!--{eval $bcid=$bcid-19}-->
				<!--{/if}-->
				<div class="bar_bg bc_$bcid">
					<div class="bar_left"></div>
					<div class="bar_middle" len="{$val[width]}px" style="width: {$val[width]}px"></div>
					<div class="bar_right"></div>
				</div>
				<!--{eval $bcid++;}-->
				<!--<div class="poll_percent">$val[vote_num] ($val[percent]%)</div>-->		
				<div class="clear"></div>
			</div>
		</li>
		<!--{/loop}-->
		<li>发起时间：{$vote[datelines]}</li>	 
      </ul>
	  <ul class="sideul">
	 	<li>
	 	  <!--{if $allowedvote && !$hasvoted}-->
	 	  <input type="button" name="Submit" class="btnText" onclick="vote();" value="投 票" />
		  <!--{else}-->
		  <input type="submit" class="canlText" id="canlText" value="已投票"  disabled="disabled"/>
		  <!--{/if}-->
	 	</li>
      </ul>

    </div>
    </form>
<script type="text/javascript">
	
	var __Bar_Name__ = 'bar_{$tid}_';
	function $$$(id)
	{
		return document.getElementById(id);
	}
    <!--{if !$hasvoted}-->
	var maxSelect = $vote[maxchoice];
	var alreadySelect = 0;
	function checkSelect(sel)
	{
		if(sel) {
			alreadySelect++;
			if(alreadySelect == maxSelect) {
				var oObj = document.getElementsByName("option[]");
				for(i=0; i < oObj.length; i++) {
					if(!oObj[i].checked) {
						oObj[i].disabled = true;
					}
				}
			}
		} else {
			alreadySelect--;
			if(alreadySelect < maxSelect) {
				var oObj = document.getElementsByName("option[]");
				for(i=0; i < oObj.length; i++) {
					if(oObj[i].disabled) {
						oObj[i].disabled = false;
					}
				}
			}
		}
	}
	<!--{/if}-->

	//效查
	var optionNum = <!--{eval echo count($option)}-->;
	var maxLength = [0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18,19];

	var timer;
	var length = 0;
	for(i = 0; i < optionNum; i++)
	{
		if ($$$(__Bar_Name__ + i)) {
			maxLength[i] = $$$(__Bar_Name__ + i).getAttribute('len');
		}
	}
	timer = setInterval(function(){
		setLength();
	}, 40);
	function setLength(){
		for (i = 0; i < optionNum; i++)
		{
			if ($$$(__Bar_Name__ + i)) {
				if (length - 1 >= maxLength[i]) {
					$$$(__Bar_Name__ + i).style.width = maxLength[i] + "px";
				} else {
					$$$(__Bar_Name__ + i).style.width = length + "px";
				}
				length = length + 1;
				if (length > 300) {
					clearInterval(timer);
				}
			}
		}
	}
</script>
<!--{/if}-->

<!--ajax 认证分类,地区显示-->	
<!--{elseif $code == 'category'}-->
	<div>
		<ul>
		<!--分类-->
			<!--{loop $category_list $val}-->
				<li><a href="index.php?mod=people&code=view&ids={$val[id]}">{$val[category_name]}</a></li>
			<!--{/loop}-->
		</ul>
	</div>
	
<!--{elseif $code == 'province'}-->
	<div>
		<ul>
		<!--地区-->
			<!--{loop $province $val}-->
				<!--{if $proviect_id}-->
					<li><a href="index.php?mod=people&code=city&pid={$proviect_id}&cid={$val[id]}">{$val[name]}</a></li>
				<!--{else}-->
					<li><a href="index.php?mod=people&code=province&pid={$val[id]}">{$val[name]}</a></li>
				<!--{/if}-->
			<!--{/loop}-->
		</ul>
	</div>
	<!--<a href="index.php?mod=people&code=province&pid={$val[id]}">-->
	
<!--{/if}-->


<!--{if $ajax_code == 'ajax_vote'}-->

	<!--ajax显示投票-->
		<div class="mWarp" style="padding:10px; width:550px;">
		<link href="styles/vote.css" rel="stylesheet" type="text/css" />
		
		<!--投票介绍 Begin--> 
		<div id="vote_desc_wp" class="vote_viewT">
			<div class="vote_viewR"  style="width:340px;">
			<p>
			<span><strong>{$vote[subject]}</strong>
			<!--{if $vote['multiple']}-->
				(最多可选{$vote['maxchoice']}项)
			<!--{else}-->
				(单选)
			<!--{/if}-->
			</span>
			<!--{if !$vote['is_view'] && !$hasvoted}-->
				<span>
					(投票后可见)
				</span>
			<!--{/if}-->
			
			<div class="vote_num2"><b>$vote['voter_num']</b></div></span>
			</p>
			<p>
			<span class="vote_date">有效期：
			<!--{eval echo my_date_format($vote['dateline'], 'Y年m月d日 H:i')}-->&nbsp;--&nbsp;<!--{eval echo my_date_format($vote['expiration'], 'Y年m月d日 H:i')}--></span>
			</p>
			</div>
			<div class="clear"></div>
		</div>
		<!--投票介绍 End-->
		
		<div>
		<!--投票选项 Begin-->
			<!--{if $vote['message']}--><p class="poll_depiction">{$vote[message]}</p><!--{/if}-->
				<form name="vote_form" method="post" action="ajax.php?mod=vote&code=vote&vid=$vote['vid']&from=topic" id="vote_form">
				
				<!--投票选项 Begin-->
					<!--{template "vote_options"}-->
				<!--投票选项 End-->
				
				<!--{if MEMBER_ID>0}-->
					<div class="poll_submit" style=" width:540px; text-align:right; padding:0">
						<!--{if $allowedvote && !$hasvoted}-->
						<input type="hidden" name="votesubmit" value="true" />
						<span style="width:100px;">
							<input type="checkbox" name="toweibo" id="toweibo_view" value="1" style="vertical-align:middle" checked="checked">
							<label for="toweibo_view">分享</label>
						</span> 
						<span style="width:100px;">
							<input type="checkbox" name="anonymous" id="anonymous_view" value="1" style="vertical-align:middle;">
							<label for="anonymous_view">匿名</label>
						</span> 
						<input type="button" class="vote_btn" id="save" value="" onclick="vote();"/>
						<!--{else}-->
						<input type="submit" class="canlText" id="save" value="已投票"  disabled="disabled"/>
						<!--{/if}-->
					</div>
				<!--{/if}-->
				</form>
		<!--投票选项 End-->
		</div>
		</div>
		<script language="javascript">
			setDialogTitle('$this->Get[handle_key]', "投票");
		</script>
		
		<script type="text/javascript">
		/**
 * 投票
 */
function vote()
{
	var post_data = $('#vote_form').serialize();
	var action = $('#vote_form').attr("action");
	if (action) {
		$.post(
			action, 
			post_data, 
			function(r){
				if (!is_json(r)) {
						/*
						$("#vote_tips").html(r.msg);
						$('#item').val('vote');
						$('#item_id').val(r.retval.vid);
						$('#topic_simple_content').html(r.retval.content);
						*/
						var handle_key = 'vote_success_share';
						showDialog(handle_key, 'local', '评论一下', {html:r}, 500);
						$('#topic_simple_close_btn').click(
							function() {
								closeDialog(handle_key);
								location.reload();
							}
						);
						$('#topic_simple_share_btn').click(
							function () {
								var response = function() {
									location.reload();
								}
								publishSimpleTopic($('#topic_simple_content').val(), 'vote', $("#topic_simple_item_id").val(), {response:response,topic_type:$('#topic_simple_type').val()});
								//publishSimpleTopic($('#topic_simple_content').val(), '', 0, {response:response});
							}
						);
				} else {
					var json = eval('('+r.toString()+')');
					if (json.done) {
						location.reload();
					} else {
						MessageBox('warning', json.msg);
					}
				}
			}
		);
	}
}
		</script>
		
	<!--ajax显示投票-->
	
<!--{/if}-->

